<%@ page import="com.dx.util.JdbcUtil" %><%--
  Created by IntelliJ IDEA.
  User: zephyrus
  Date: 2023/11/30
  Time: 上午10:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //将请求数据的字符编码设为utf-8
    request.setCharacterEncoding("utf-8");
    String username=request.getParameter("username");
    String password=request.getParameter("password");
    String realName=request.getParameter("real_name");
    String sql="insert into tb_user(username,password,real_name) values(?,?,?)";
    JdbcUtil util=new JdbcUtil();
    int count=util.executeUpdate(sql,username,password,realName);
    if(count==1){
        out.print("<script>alert('更新成功');location='login.jsp';</script>");
    }else{
        out.print("<script>alert('更新失败');location='login.jsp';</script>");
    }
%>
